Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 1c9c74410790188db976dbecdff3b994d33ac5d9


Parents : bfed126
Author : Mark Qvist <mark@unsigned.io>
Date : 2025-01-21T16:51:25+01:00

Memory optimisations

Changes

1 files changed, 2 insertions(+), 2 deletions(-)


Diff

diff --git a/LXMF/LXMPeer.py b/LXMF/LXMPeer.py
index d133027..add54da 100644
--- a/LXMF/LXMPeer.py
+++ b/LXMF/LXMPeer.py
@@ -360,6 +360,7 @@ class LXMPeer:
pes = self.router.propagation_entries.copy()
hm = list(filter(lambda tid: self.destination_hash in pes[tid][4], pes))
self._hm_count = len(hm); del pes
+ self._hm_counts_synced = True
return hm
@property
@@ -367,6 +368,7 @@ class LXMPeer:
pes = self.router.propagation_entries.copy()
um = list(filter(lambda tid: self.destination_hash in pes[tid][5], pes))
self._um_count = len(um); del pes
+ self._um_counts_synced = True
return um
@property
@@ -387,12 +389,10 @@ class LXMPeer:
if not self._hm_counts_synced:
RNS.log("UPDATE HM COUNTS")
hm = self.handled_messages; del hm
- self._hm_counts_synced = True
if not self._um_counts_synced:
RNS.log("UPDATE UM COUNTS")
um = self.unhandled_messages; del um
- self._um_counts_synced = True
def add_handled_message(self, transient_id):
if transient_id in self.router.propagation_entries:


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────